package com.lvmama.pangolin.qnr.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.lvmama.pangolin.entity.InputCommodityVO;
import com.lvmama.pangolin.entity.qnr.QNRTicketCommodityItem;
import com.lvmama.pangolin.entity.qnr.QNRTicket_CommodityDetail;
import com.lvmama.pangolin.mybatis.mapper.qnr.QNRTicketCommodityItemsMapper;
import com.lvmama.pangolin.qnr.service.QNRTicketCommodityItemsService;
@Transactional
@Service
public class QNRTicketCommodityItemsServiceImpl implements QNRTicketCommodityItemsService{
	/**  
	* @Title：TCCommodityItemsServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年3月6日下午4:33:17  
	*/
	@Autowired
	private QNRTicketCommodityItemsMapper qnrCommodityItemsMapper;

	@Override
	public List<QNRTicketCommodityItem> selectByProdidAndIsLinked(Map<String, String> map) {
		return qnrCommodityItemsMapper.selectByProdidAndIsLinked(map);
	}

	public int insert(QNRTicket_CommodityDetail item)throws Exception{
		return qnrCommodityItemsMapper.insert(item);
	}
	public QNRTicketCommodityItem selectById(String id,String productId)throws Exception{
		return qnrCommodityItemsMapper.selectById(id,productId);
	}
	public int update(QNRTicket_CommodityDetail item)throws Exception{
		return qnrCommodityItemsMapper.update(item);
	}
	@Override
	public List<QNRTicketCommodityItem> selectByProdId(String product_id) {
		return qnrCommodityItemsMapper.selectByProdId(product_id);
	}
	@Override
	public QNRTicketCommodityItem selectByProdCommId(String productId, String commodityId) {
		return qnrCommodityItemsMapper.selectByProdCommId(productId, commodityId);
	}
	@Override
	public void updateByProdCommId(String productId, String commodityId) {
		qnrCommodityItemsMapper.updateByProdCommId(productId, commodityId);
		
	}
	@Override
	public void deleteLinkByProdCommId(String productId, String commodityId) {
		qnrCommodityItemsMapper.deleteLinkByProdCommId(productId, commodityId);
		
	}
	@Override
	public void updateSelective(QNRTicketCommodityItem item) {
		qnrCommodityItemsMapper.updateSelective(item);
		
	}
	@Override
	public void deleteById(String id) {
		qnrCommodityItemsMapper.deleteById(id);
		
	}
	@Override
	public void insertSelective(QNRTicketCommodityItem item) {
		qnrCommodityItemsMapper.insertSelective(item);
		
	}
	@Override
	public List<QNRTicketCommodityItem> selectByProdComName(String productId, String commodityName) {
		return qnrCommodityItemsMapper.selectByProdComName(productId, commodityName);
	}
	@Override
	public List<QNRTicketCommodityItem> selectByCommVO(InputCommodityVO co) {
		PageHelper.startPage(co.getPage(), co.getPageSize());
		return qnrCommodityItemsMapper.selectByCommVO(co);
	}
	@Override
	public int updateByProdCommIdAndType(QNRTicket_CommodityDetail item) throws Exception {
		return qnrCommodityItemsMapper.updateByProdCommIdAndType(item);
	}
	@Override
	public List<QNRTicketCommodityItem> getActiveCommodity(String productId) {
		return qnrCommodityItemsMapper.getActiveCommodity(productId);
	}
}
